import { request } from '../request';

/** get list */
export function categoryList(params: Api.SystemManage.CategorySearchParams) {
  return request<Api.SystemManage.CategoryList>({
    url: '/category/list',
    method: 'post',
    data: params
  });
}

/** save */
export function categorySave(params?: Api.SystemManage.CategorySaveParams) {
  return request<boolean>({
    url: '/category/add',
    method: 'post',
    data: params
  });
}

/** update */
export function categoryUpdate(params?: Api.SystemManage.CategoryUpdateParams) {
  return request<boolean>({
    url: '/category/update',
    method: 'post',
    data: params
  });
}

/** get */
export function categoryGet(params: { id: string }) {
  return request<Api.SystemManage.Category>({
    url: '/category/get',
    method: 'post',
    data: params
  });
}

/** del */
export function categoryDel(params: { id: string }) {
  return request<boolean>({
    url: '/category/del',
    method: 'post',
    data: params
  });
}

/** delBatch */
export function categoryDelBatch(params: { ids: Array<string> }) {
  return request<boolean>({
    url: '/category/delBatch',
    method: 'post',
    data: params
  });
}
